package com.tianheng.wanzhou.datacollecting.netty.zhengjing.receiver;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tianheng.wanzhou.datacollecting.netty.zhengjing.receiver.receiverImpl.HuafReceiver;
import com.tianheng.wanzhou.datacollecting.netty.zhengjing.receiver.receiverImpl.KaiyReceiver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: yujw
 * @Date: 2020/5/16 15:50
 * @Version 1.0
 */
@Component
public class ReceiverFactory {

    @Autowired
    HuafReceiver huafReceiver;
    @Autowired
    KaiyReceiver kaiyReceiver;

    public Receiver getReceiver(String type) {
        Receiver receiver = null;
        if (type.equals("01")) {
            receiver = this.huafReceiver;
        }
        if (type.equals("02")) {
            receiver = this.kaiyReceiver;
        }
        return receiver;
    }
}
